package com.xiantm.study.thread.towparsetermination.q8;

public class Main {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            while (true) {
                try {
                    if (Thread.interrupted()) {
                        throw new InterruptedException();
                    }
                    System.out.print(".");
                } catch (InterruptedException e) {
                    System.out.print("*");
                }
            }
        });

        thread.start();

        try {
            Thread.sleep(5);
        } catch (InterruptedException e) {
        }
        thread.interrupt();
    }
}
